<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>

	<style type="text/css">
	
	
.ui-panelgrid tr,.ui-panelgrid td {
	border: none;
}
</style>
</h:head>
<h:body>

	<h:form id="login">

		<p:panelGrid columns="2" style="margin: 0 auto; margin-top: 200px; min-width: 60%">
			<f:facet name="header">  
							
	        	Inserisci l'email a cui inviare l'invito
    		</f:facet>

			<p:outputLabel for="email" value="email" />
			<p:inputText id="email" name="email" required="true" style="min-width: 90%"
				binding="#{email}" requiredMessage="Inserisci email" 
				validatorMessage="Inserire una mail valida!">
				<!-- Controllo che venga inserita una email -->
				<f:validateRegex
					pattern="^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" />
			</p:inputText>
			<p:growl id="growl" for="email" showDetail="true"
			life="3500" />
			<p:message for="email" />
			<f:facet name="footer">
				<p:commandButton value="Invia"
					action="#{pacchettoBean.inviaInvito(email.value)}" update="login" />

				<p:commandButton value="Indietro" style="float: right"
					oncomplete="window.history.back();" />
			</f:facet>

		</p:panelGrid>

	</h:form>


</h:body>
</html>